<?php

namespace api\controller;


use common\controller\VerifyController;
use common\exception\LogicException;
use common\service\FixService;
use think\Request;
use think\Response;

class FixController extends VerifyController
{

    protected $fixService;

    public function __construct()
    {
        parent::__construct();
        $this->fixService = new FixService();
    }

    /**
     * 获取租户列表
     * @param Request $request
     * @return \think\Response
     */
    public function formatMessageCard0628(Request $request)
    {
        try {
            $resData = $this->fixService->formatMessageCard0628($request->param()['param']['filter'] ?? [], $request->param()['param']['page']);
            return json(success_response('OK', $resData));
        } catch (LogicException $e) {
            throw_strack_exception($e->getMessage(), $e->getCode());
        }
    }

    /**
     * 转换租户用户到tenantUserDepartment/ tenantUserRole
     * @param Request $request
     * @return Response|void
     * @throws \Exception
     */
    public function transferTenantUserData0427(Request $request)
    {
        try {
            $resData = $this->fixService->transferTenantUserData0427();
            return json(success_response('OK', $resData));
        } catch (LogicException $e) {
            throw_strack_exception($e->getMessage(), $e->getCode());
        }
    }
}
